package ylg.com.cn.beuty;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import ylg.com.cn.beuty.config.MyApplication;
import ylg.com.cn.beuty.main.MainActivity;

/**
 * Created by MyPC on 2017/1/13.
 */
public class WelcomeActivity extends Activity {
    public Context mContext;
    // 程序是否使用过
    private boolean isUse;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        mContext = WelcomeActivity.this;
        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                if (MyApplication.getInstance().isLogin()) {// -1表示没有用户登录
                    Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
                    startActivity(intent);
                    finish();
                } else {
                    Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
                    startActivity(intent);
                    finish();
                }
            }
        }, 1200);
    }


}
